package service.impl;

import dao.UserMapper;
import entity.PermissionRole;
import entity.Role;
import entity.TreeNode;
import entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import service.UserService;

import java.math.BigDecimal;
import java.util.List;
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public List<User> findAllUser() {
        return userMapper.findAllUser();
    }

    @Override
    public List<User> findUserByID(String name) {
        return userMapper.findUserByID(name);
    }

    @Override
    public Integer insertOne(User user) {
        return userMapper.insertOne(user);
    }

    @Override
    public Integer deleteUserByID(String id) {
        return userMapper.deleteRoleByID(id);
    }

    @Override
    public Integer batchDeleteUser(String[] userList) {
        return userMapper.batchDeleteUser(userList);
    }

    @Override
    public List<Role> findRolesByUsername(String username) {
        return userMapper.findRolesByUsername(username);
    }

    @Override
    public List<PermissionRole> findPermissionProleByUsername(String username) {
        return userMapper.findPermissionProleByUsername(username);
    }

    @Override
    public List<TreeNode>  findResource() {
        return userMapper.findResource();
    }

    @Override
    public List<TreeNode> findMenuList() {
        return userMapper.findMenuList();
    }

}
